home *** CD-ROM | disk | FTP | other *** search
- 0, In this demonstration, you will see how to use the
- 6, Query Designer in Visual InterDev to create and
- 9, run SQL queries. To use the Query Designer, from the
- 14, Data View tab double-click a table to open the
- 18, table. The Query Designer is composed of several
- 22, panes. To display each pane, click the appropriate
- 26, icon on the Query toolbar. I'll display the Diagram
- 30, pane, the Grid pane, the SQL pane, and Results
- 36, pane. You can use these panes to modify your query.
- 41, For example, I can select which column I want to
- 45, include in my query by selecting the column in the
- 49, Diagram pane. When I select a column, the column
- 54, is listed in the Grid pane and the SQL is updated
- 59, in the SQL pane. You can also type directly in the
- 63, SQL pane. For example, I'll add "MajorID" to my
- 70, SQL. When I tab away the other panes are updated.
- 77, You can add criteria to limit the results of a
- 81, query. For example, I'll add the criteria "='MT101'" to
- 94, the Class ID to limit the results to a specific
- 97, class. To run the query, click the Run icon on the
- 103, Query toolbar. The query is executed and the results
- 107, are displayed in the Results pane. To add a table
- 112, to the query, drag the table from the Data View
- 116, tab to the Diagram pane. If the tables are related,
- 124, a join line appears. To modify the properties of
- 128, the join, right-click the join line and click
- 131, Properties. You can create SQL statements that include
- 141, aggregate values, such as count, max, and min.
- 145, For example, I'll create a query that displays the
- 149, number of students in each class. To do that I'll
- 154, select ClassID from the Classes table and StudentID
- 160, from the Enrollment table. To add a "Group By"
- 164, column to the grid, right-click in the Diagram pane
- 169, and select Group By. For StudentID I'll choose the
- 176, function "Count." For ClassID I'll remove the
- 183, criteria to select all classes and run the query. The
- 189, query executes and the results are displayed in
- 192, the Results pane. You can also execute stored
- 199, procedures by entering the SQL statement directly in
- 204, the SQL pane. For example, I'll execute the
- 208, procedure "Get Student GPA" and pass in a student ID.
- 221, When I execute the query, I'll see a dialog box that
- 226, indicates that this query cannot be displayed
- 230, visually. If I choose Yes, the Diagram and Grid panes
- 235, are disabled. However, the SQL continues to execute
- 239, and the results are displayed in the Results
- 242, pane. So, in this demonstration you have seen how to
- 248, use the Query Designer in Visual InterDev to create
- 253, and execute SQL queries.
- 256, END
-